<script type="text/javascript">

    var $componentDialog = $.pdialog.getCurrent();
    
    function componentValidateCallback() {
        var $form = $("#operationComponentForm");

        if (!$form.valid()) {
            return false;
        }
        var data = [];
        data["componentCode"] = $("input#operationComponentLookup\\.materialCode").val();
        data["componentText"] = $("input#operationComponentLookup\\.materialText").val();
        data["quantity"] = $("input[name='quantity']", $.pdialog.getCurrent()).val();
        var popId = $("input[name='popId']",$.pdialog.getCurrent()).val();
        if(popId && popId != "")
            data["processOperationID"] = popId;
        _addProcessComponent(data);
        $.pdialog.close($componentDialog);
    }
    
/*     function test(element) {
    	var hiddenId = $(element).attr("hiddenId");"operationComponentLookup\\.materialCode";
    	console.log($(element).parent().find("#"+hiddenId).val());
    	console.log($(element).parent().find("#operationComponentLookup\\.materialCode").val());
    } */
    
</script>
    <form id="operationComponentForm" method="post" action="" class="pageForm required-validate">
        <div class="pageContent">
        <div class="pageFormContent" layoutH="56">
         <input type="hidden" name="popId" value="${popId!''}">
            <fieldset>
            <dl class="notnormal">
                <dt><@label key="component.C,colon">组件：</@label></dt>
                <dd>
                    <input id="operationComponentLookup.materialCode" name="componentCode" value="" type="hidden"/>
                    <input class="required look" id="operationComponentLookup.materialText" name="componentText" type="text" postField="materialCode" suggestFields="materialCode,materialText" 
                    suggestUrl="${rc.getContextPath()}/manage/material/componentSuggest" lookupGroup="operationComponentLookup" hiddenId="operationComponentLookup.materialCode"
                    remote="${rc.getContextPath()}/manage/material/validateMaterial" warn="<@label key='materialCodeNotExists.M'>物料编号不存在</@label>"/>
                    <a class="btnLook" href="${rc.getContextPath()}/manage/material/componentLookUp?lookupType=radio" rel="operationComponentl_dialog" title="<@label key='select.C,materialCode.C'>选择物料</@label>" lookupGroup="operationComponentLookup" ></a>
                </dd>
            </dl>
            <dl>
                <dt><@label key="quantity.C,colon">数量：</@label></dt>
                <dd><input type="text" name="quantity" class="required number" maxlength="6"/></dd>
            </dl>
            </fieldset>
        </div>
        <div class="formBar">
            <ul>
                <li><div class="buttonActive"><div class="buttonContent" onclick="componentValidateCallback();"><button type="button">保存</button></div></div></li>
                <li>
                    <div class="buttonActiveGrey"><div class="buttonContent"><button type="button" class="close"><@label key="cancel.B">取消</@label></button></div></div>
                </li>
            </ul>
        </div>
        </div>
    </form>

